package com.uni.entity;


import lombok.Data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Data
public class Office {
    private Long id;
    private String countryName;
    private String email;
    private String phone;
    private String addr;
    private String imgUrl;

    public List<String> getImgUrls(){
                if (imgUrl==null||imgUrl.trim()==""){
            return Collections.emptyList();
        }
        String[] split = imgUrl.split(",");
        List<String> list=new ArrayList<String>();
        for (int i=0;i<split.length;i++){
            //&& !split[i].startsWith("http")
            if(split[i] != null && !"".equals(split[i]) ) {
                list.add( split[i]) ;
            }
            continue;
        }
        return list;
    }

}
